﻿using System;
using System.ServiceModel;
using Windows.UI.Popups;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using Zombie.Services.Definitions;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace WindowsStoreDemoClient
{
	/// <summary>
	/// An empty page that can be used on its own or navigated to within a Frame.
	/// </summary>
	public sealed partial class MainPage : Page
	{
		public MainPage()
		{
			this.InitializeComponent();
		}

		/// <summary>
		/// Invoked when this page is about to be displayed in a Frame.
		/// </summary>
		/// <param name="e">Event data that describes how this page was reached.  The Parameter
		/// property is typically used to configure the page.</param>
		protected override void OnNavigatedTo(NavigationEventArgs e)
		{
		}

		async private void Button_Click_1(object sender, RoutedEventArgs e)
		{
			var testObject = new ZombieSighting();
			testObject.AddressLine1 = "This is an address";


			var b = new BasicHttpBinding();
			var ep = new EndpointAddress("http://localhost:7104/InformationService.svc");

			var client = new InformationClient(b, ep);
			var result = await client.Channel.ListZombieTypes();
			MessageDialog md = new MessageDialog(result.ToString(), "Title");
			await md.ShowAsync();
		}
	}
}
